package com.bwie.utils;

import org.apache.ibatis.executor.ResultExtractor;

import java.io.Serializable;

/**
 * @Author:Max
 * @Date: 2024/8/9 19:00
 * @Description
 **/
public class ResultTwo implements Serializable {
    private int code;
    private String msg;
    private Object data;

    public static  ResultTwo ok(){
        ResultTwo result = new ResultTwo();
        result.setCode(200);
        result.setMsg("登录成功");
        result.setData(null);
        return result;
    }

    public  static ResultTwo error(){
        ResultTwo result = new ResultTwo();
        result.setMsg("登录失败");
        result.setData(null);
        result.setCode(500);
        return result;
    }


    public int getCode() {
        return code;
    }

    public ResultTwo setCode(int code) {
        this.code = code;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public ResultTwo setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public Object getData() {
        return data;
    }

    public ResultTwo setData(Object data) {
        this.data = data;
        return this;
    }
}
